      FUNCTION MKFMT(IN,INFOR,IO)
C
C *** ************************************************************** ***
C *** *                                                            * ***
C *** *  COPYRIGHT (C) 1989 by The University of Texas at Austin   * ***
C *** *                                                            * ***
C *** * Permission is hereby granted to use, modify, copy, and     * ***
C *** * distribute this software and its documentation for any     * ***
C *** * purpose only without profit, provided that the above       * ***
C *** * Copyright Notice appears in all copies and that both the   * ***
C *** * Copyright Notice and this Permission Notice appears in     * ***
C *** * every copy of supporting documentation.  No title to nor   * ***
C *** * ownership of the software is transferred hereby.  The name * ***
C *** * of The University of Texas at Austin shall not be used in  * ***
C *** * advertising or publicity related to the distribution of    * ***
C *** * the software without specific, written, prior permission.  * ***
C *** * This software is provided as-delivered without expressed   * ***
C *** * or implied warranty.  The University of Texas at Austin    * ***
C *** * makes no representation about the suitability of this      * ***
C *** * software for any purpose and accepts no responsibility for * ***
C *** * its use.                                                   * ***
C *** *                                                            * ***
C *** ************************************************************** ***
C *** *                                                            * ***
C *** * This program is free software; you can redistribute it     * ***
C *** * and/or modify it under the terms of the GNU General Public * ***
C *** * License as published by the Free Software Foundation;      * ***
C *** * either version 2 of the License, or (at your option) any   * ***
C *** * later version.                                             * ***
C *** *                                                            * ***
C *** * This program is distributed in the hope that it will be    * ***
C *** * useful, but WITHOUT ANY WARRANTY; without even the implied * ***
C *** * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR    * ***
C *** * PURPOSE.  See the GNU General Public License for more      * ***
C *** * details.                                                   * ***
C *** *                                                            * ***
C *** * You should have received a copy of the GNU General Public  * ***
C *** * License along with this program; if not, write to the Free * ***
C *** * Software Foundation, Inc., 51 Franklin Street, Fifth       * ***
C *** * Floor, Boston, MA 02110-1301, USA.                         * ***
C *** *                                                            * ***
C *** * For more information: http://www.gnu.org/licenses/gpl.html * ***
C *** *                                                            * ***
C *** ************************************************************** ***
C
C   THIS CHARACTER FUNCTION TAKES <IN> INDIVIDUAL FORMAT SPECS.
C   FROM THE DIMENSIONED CHARACTER ARRAY <INFOR> AND BUILDS A
C   FORMAT CHARACTER STRING INTO THE CHARACTER VARIABLE <MKFMT>,
C   INCLUDING THE PROPER PARENTHESIS AND COMMAS.  <IO> IS SET TO
C   TO THE NUMBER OF CHARACTERS IN <IOFOR>.
C   <MKFMT> MUST BE DECLARED TYPE CHARACTER BY THE CALLER.
C
      IMPLICIT          NONE                                            CCODE=C.
      CHARACTER*(*)  MKFMT
      INTEGER        IN      ,IO
      CHARACTER*(*)  INFOR(*)
      INTEGER   N1
      PARAMETER(N1=1)
      INTEGER   I,ILEN,ILNB,IT1
      IO=N1
      MKFMT='('
      DO 100 I=N1,IN
      ILEN=ILNB( INFOR(I) )
      IF(ILEN.EQ.0)GO TO 100
      IT1=IO+N1
      IO=IO+ILEN
      MKFMT(IT1:IO)=INFOR(I)(1:ILEN)
      IO=IO+N1
      MKFMT(IO:IO)=','
  100 CONTINUE
      MKFMT(IO:IO)=')'
      RETURN
      END
